const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
    mode:'development',
    devtool:'source-map',
    entry:{
        app:['./src/main.js'],
        vendor:['lodash']
    },
    output:{
        path:path.resolve('dist'),
        filename:'[name].[hash:8].js'
    },
    module:{
        rules:[
            {
                test:/\.vue$/,
                loader:'vue-loader'
            },
            {
                test:/\.css$/,
                use:[
                    'style-loader',
                    'css-loader'
                ]
            }
        ]
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:'./public/index.html',
            filename:'index.html'
        }),
        new VueLoaderPlugin()
    ]
}